<div class="crumb-wrap">
             <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url('admini') ?>">首页</a><span class="crumb-step">&gt;</span><a href="<?=site_url('admini/sort') ?>">分类管理</a><span class="crumb-step">&gt;</span><span>分类属性</span></div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="<?=site_url('admini/Attribute/create?sid='.$this->input->get('sid'))?>"><i class="icon-font"></i>新增属性</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>属性名称</th>
                            <th>默认参数</th>
                            <th width="40%">描述</th>
                            <th>操作时间</th>
                            <th>操作</th>
                        </tr>
                        <?php foreach($list as $key => $value):?>
                        <tr style="background-color: #e5e5e5;">
                        	<td align="center" colspan=4><?=$value['aname']?></td>
                        	<td>
                                <a class="link-del" href="javascript:del_att(<?=$value['id']?>);">删除</a>
                            </td>
                        </tr>
                        <?php foreach($value['tree'] as $k => $v):?>
                        <tr>
                            <td><?=$v['aname']?></td>
                            <td><?=$v['avalue']?></td>
                            <td><?=$v['describe']?></td>
                            <td><?=date('Y-m-d H:i:s',$v['create_time'])?></td>
                            <td>
                                <a class="link-update" href="<?=site_url('admini/attribute/update?aid='.$v['id'])?>">修改</a>
                                <a class="link-del" href="javascript:del_att(<?=$v['id']?>);">删除</a>
                            </td>
                        </tr>
                        <?php endforeach;?>
                        <?php endforeach;?>
                    </table>
                </div>
            </form>
        </div>
        <script>
        	function del_att(aid){
        		$.post("<?=site_url('admini/attribute/delete')?>",{aid:aid},function(res){
        			if(res == 1){
	                    location.reload(true);
	                }else{
	                    layer.alert(res,{
	                        icon:2,
	                    });
	                }
        		});
        	}
        	
        </script>